package com.crazy.web.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * freemarket配置
 */
@Configuration
public class FreeMarkerConfig {

    @Autowired
    private freemarker.template.Configuration configuration;

    /**
     * 此处以key-value的形式将值写入到freemarket的全局变量中
     * 服务器加载Servlet的时候运行，并且只会被服务器执行一次
     * @throws Exception
     */
    @PostConstruct
    public void setConfigure() throws Exception {
//        configuration.setSharedVariable("cdnPath", "//dev2.nbeport.com/cdn");
    }
}
